#include<bits/stdc++.h>
#define int long long
#define endl "\n"

using namespace std;

signed main() {
	string s;
	cin >> s;
	int ret = 0;
	for(int i = 0; i < s.size(); i ++ ) {
		if(s[i] == '0' && i != s.size() - 1) {
			if(s[i + 1] == '0') {
				ret ++ ;
				i ++ ;
			} else {
				ret ++ ;
			}
		} else {
			ret ++ ;
		}
	}
	cout << ret << endl;
	return 0;
}

